#ifndef HEAD_H_
#define HEAD_H_

#include "EnumerationCollisionTypes.h"
#include "Tail.h"
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace sf;

class Head {
private:
	Vector2f direction;
	float moveSpeed;
	float turnSpeed;
	Shape shape;
	bool turningLeft, turningRight, turning;
	bool alive;
	Tail tail;
	Vector2f calculateTailDockingPosition();
public:
	Head(Vector2f position, Vector2f size, Color color, float speed, Vector2f direction);
	void update(float deltaTime);
	void render(RenderWindow& renderWindow);
	Shape getCollisionShape() const;
	void computeCollision(EnumerationCollisionTypes collisionTypes);
	void turnLeft();
	void turnRight();
	bool isAlive() const;
	Color getColor();
	Shape getNewTailPiece();
};

#endif /* HEAD_H_ */
